package com.demo.base.resp;

import java.io.Serializable;

import lombok.Data;

@Data
public class ResufulResult implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int code;
	private String message;
	private Object data;
	public ResufulResult(int code, String message, Object data) {
		super();
		this.code = code;
		this.message = message;
		this.data = data;
	}
	
	public static ResufulResult succeed() {
		return new ResufulResult(200, "成功", null);
	}
	public static ResufulResult succeed(Object data) {
		return new ResufulResult(200, "成功", data);
	}
	
	public static ResufulResult fail(String message) {
		return new ResufulResult(500, message, null);
	}
}
